<template>
  <div>
    <ul class="ultwo">
      <li @click="actdet(item)" v-for="(item,index) in dataty" :key="index">
        <div class="li-top">
          <img :src="item.main_pic" alt="">
          <span>{{item.apply}}</span>
          <span v-if="item.is_rec==0?false:true">推荐</span>
        </div>
        <p>{{item.title}}</p>
      </li>
    </ul>
  </div>
</template>

<script>
  import * as home from "../../../api/home.js"
  export default {
    name: "Ball",
    data(){
      return {
        dataty:[]
      }
    },
    beforeMount(){
      let parmes = {type:2};
      home.activeList(parmes).then(res=>{
        this.dataty = res.data;
      })
    },
    mounted(){
      mui.back = function() {
        window.history.go(-1);
      }
    },
    methods:{
      actdet(item){
        this.$router.push({path:'/active2/0/'+item.id});
      }
    }
  }
</script>

<style scoped>
  .ultwo{
    padding: 20px 40px 0;
  }
  .ultwo li{
    position: relative;
    border-radius: 20px;
    background: #e7c7fd;
    margin-bottom: 30px;
    overflow: hidden;
  }
  .ultwo li .li-top{
    position: relative;
    height: 400px;
    overflow: hidden;
  }
  .ultwo li .li-top img{
    width: 100%;
    height: 100%;
  }
  .ultwo li .li-top span{
    position: absolute;
    left: 20px;
    top: 20px;
    display: inline-block;
    cursor: pointer;
  }
  .ultwo li .li-top span:nth-child(2){
    position: absolute;
    right: 20px;
    top: 20px;
    width: 90px;
    height: 40px;
    border-radius: 20px;
    text-align: center;
    line-height: 40px;
    background: #ff6174;
    color: #fff;
  }
  .ultwo li .li-top span:nth-child(3){
    width: 52px;
    height: 63px;
    background: url("/static/lyl/recom.png") no-repeat center/cover;
    font-size: 24px;
    color: #fff;
    float: right;
    text-align: center;
  }
  .ultwo li p{
    position: absolute;
    left: 0;
    bottom: 0;
    box-sizing: border-box;
    width: 100%;
    font-size: 24px;
    color: #fff;
    padding: 13px 0 10px 20px;
    background: rgba(0,0,0,0.7);
  }
</style>
